<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <title>example methods demo</title>
    <script type="text/javascript" src="../assets/js/vue.js"></script>
    <script type="text/javascript" src="../assets/js/jquery-3.3.1.js"></script>
</head>

<body>
    <h1>example methods demo</h1>
    <hr>
    <div id="app">
        <p>{{message}}</p>
    </div>
    <script type="text/javascript">
        var app = new Vue({
            el: '#app',
            data: {
                message:'hello vue'
            },
            //在Vue中使用jQuery
            mounted:function(){
                $("#app p").html("我是jQuery!");
            },
            methods:{
                add:function(){
                    console.log("调用了Add方法");
                }
            }
        })
        app.add();
    </script>
</body>

</html>